<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>风盾金控服务平台--填写个人基础信息</title>
    <link th:href="@{/loanStatic/css/fromSumbit/style.css}" rel="stylesheet" type="text/css">
    <link th:href="@{/loanStatic/tip/mdialog.css}" rel="stylesheet" type="text/css">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="format-detection" content="telephone=no, email=no" />
</head>
<body>
<header>
    <img th:src="@{/loanStatic/images/fromSumbit/rpw_back_n.png}"/>
    <span>填写紧急联系人信息</span>
    <div class="clear"></div>
</header>
<article class="info">
   <ul>
       <li>
           <div class="left">联系人姓名:
           </div>
           <div class="right">
             <input placeholder="请输入联系人姓名" id="cName1"  name="cName1"/>
           </div>
           <div class="clear"></div>
       </li>
       <li>
           <div class="left">联系人电话:
           </div>
           <div class="right">
               <input type="tel" placeholder="请输入联系人电话" onkeyup="value=value.replace(/[^\d]/g,'')" id="cMoblie1"  name="cMoblie1"/>
           </div>
           <div class="clear"></div>
       </li>
       <li>
           <div class="left">联系人关系:
           </div>
           <div class="right">
               <div class="mask_select"></div>
               <div id="divselect">
                   <small>请输入与联系人关系</small>
                   <ul class="all">
                       <li><a href="javascript:;">父亲</a></li>
                       <li><a href="javascript:;">母亲</a></li>
                       <li><a href="javascript:;">夫妻</a></li>
                       <li><a href="javascript:;">兄弟</a></li>
                       <li><a href="javascript:;">亲戚</a></li>
                       <li><a href="javascript:;">朋友</a></li>
                       <li><a href="javascript:;">同事</a></li>
                   </ul>
               </div>
               <input name="" type="hidden" value="" id="inputselect" name="cRelationship1"/>
           </div>
           <div class="clear"></div>
       </li>
       <li>
           <div class="left">联系人姓名:
           </div>
           <div class="right">
               <input placeholder="请输入联系人姓名" id="cName2"  name="cName2"/>
           </div>
           <div class="clear"></div>
       </li>
       <li>
           <div class="left">联系人电话:
           </div>
           <div class="right">
               <input type="tel" placeholder="请输入联系人电话" onkeyup="value=value.replace(/[^\d]/g,'')" id="cMoblie2"  name="cMoblie2"/>
           </div>
           <div class="clear"></div>
       </li>
       <li>
       	<div class="left">联系人关系:
           </div>
       	<div class="right">
               <div class="mask_select"></div>
               <div id="divselectx">
                   <small>请输入与联系人关系</small>
                   <ul class="all">
                       <li><a href="javascript:;">父亲</a></li>
                       <li><a href="javascript:;">母亲</a></li>
                       <li><a href="javascript:;">夫妻</a></li>
                       <li><a href="javascript:;">兄弟</a></li>
                       <li><a href="javascript:;">亲戚</a></li>
                       <li><a href="javascript:;">朋友</a></li>
                       <li><a href="javascript:;">同事</a></li>
                   </ul>
               </div>
               <input name="" type="hidden" value="" id="inputselectx" name="cRelationship2"/>
           </div>
           <div class="clear"></div>
       </li>
       <li>
           <div class="left">联系人姓名:
           </div>
           <div class="right">
               <input type="tel" placeholder="请输入联系人姓名" id="cName3"  name="cName3"/>
           </div>
           <div class="clear"></div>
       </li>
       <li>
           <div class="left">联系人电话:
           </div>
           <div class="right">
               <input type="tel" onkeyup="value=value.replace(/[^\d]/g,'')"  placeholder="请输入联系人电话" id="cMoblie3"  name="cMoblie3"/>
           </div>
           <div class="clear"></div>
       </li>
       <li>
           <div class="left">联系人关系:
           </div>
           <div class="right">
               <div class="mask_select"></div>
               <div id="divselecty">
                   <small>请输入与联系人关系</small>
                   <ul class="all">
                       <li><a href="javascript:;">父亲</a></li>
                       <li><a href="javascript:;">母亲</a></li>
                       <li><a href="javascript:;">夫妻</a></li>
                       <li><a href="javascript:;">兄弟</a></li>
                       <li><a href="javascript:;">亲戚</a></li>
                       <li><a href="javascript:;">朋友</a></li>
                       <li><a href="javascript:;">同事</a></li>
                   </ul>
               </div>
               <input name="" type="hidden" value="" id="inputselecty" name="cRelationship3"/>
           </div>
           <div class="clear"></div>
       </li>
   </ul>
</article>
<article class="btn-1">
    <button onclick="userContactSubmit()">确认提交</button>
</article>

<script th:src="@{/loanStatic/js/fromSumbit/jquery.min.js}" type="text/javascript"></script>
<script>window.jQuery || document.write('<script th:src="@{/loanStatic/js/fromSumbit/jquery-2.1.1.min.js}"><\/script>')</script>
<script th:src="@{/loanStatic/js/fromSumbit/iscroll-zoom.js}"></script>
<script th:src="@{/loanStatic/js/fromSumbit/hammer.js}"></script>
<script th:src="@{/loanStatic/js/fromSumbit/jquery.photoClip.js}"></script>
<script th:src="@{/loanStatic/tip/zepto.min.js}"></script>
<script th:src="@{/loanStatic/tip/mdialog.js}"></script>
<script>
function userContactSubmit(){
	var cName1=$("#cName1").val();
	var cMoblie1=$("#cMoblie1").val();
	var cRelationship1=$("#inputselect").val();
	var cName2=$("#cName2").val();
	var cMoblie2=$("#cMoblie2").val();
	var cRelationship2=$("#inputselectx").val();
	var cName3=$("#cName3").val();
	var cMoblie3=$("#cMoblie3").val();
	var cRelationship3=$("#inputselecty").val();
	
	if(cName1==null || cName1==""){
		new TipBox({type:'tip',str:'联系人不能为空',clickDomCancel:true,setTime:1300,hasBtn:false});
		return;
	}
	if(cMoblie1==null || cMoblie1==""){
		new TipBox({type:'tip',str:'电话不能为空',clickDomCancel:true,setTime:1300,hasBtn:false});
		return;
	}
	if(cRelationship1==null || cRelationship1==""){
		new TipBox({type:'tip',str:'关系不能为空',clickDomCancel:true,setTime:1300,hasBtn:false});
		return;
	}
	if(cName2==null || cName2==""){
		new TipBox({type:'tip',str:'联系人不能为空',clickDomCancel:true,setTime:1300,hasBtn:false}); 
		return;
	}
	if(cMoblie2==null || cMoblie2==""){
		new TipBox({type:'tip',str:'电话不能为空',clickDomCancel:true,setTime:1300,hasBtn:false}); 
		return;
	}
	if(cRelationship2==null || cRelationship2==""){
		new TipBox({type:'tip',str:'关系不能为空',clickDomCancel:true,setTime:1300,hasBtn:false});
		return;
	}
	if(cName3==null || cName3==""){
		new TipBox({type:'tip',str:'联系人不能为空',clickDomCancel:true,setTime:1300,hasBtn:false}); 
		return;
	}
	if(cMoblie3==null || cMoblie3==""){
		new TipBox({type:'tip',str:'电话不能为空',clickDomCancel:true,setTime:1300,hasBtn:false}); 
		return;
	}
	if(cRelationship3==null || cRelationship3==""){
		new TipBox({type:'tip',str:'关系不能为空',clickDomCancel:true,setTime:1300,hasBtn:false}); 
		return;
	}
	
	var dataParam={"userId":1,
				   "cName1":cName1,
				   "cMoblie1":cMoblie1,
				   "cRelationship1":cRelationship1,
				   "cName2":cName2,
				   "cMoblie2":cMoblie2,
				   "cRelationship2":cRelationship2,
				   "cName3":cName3,
				   "cMoblie3":cMoblie3,
				   "cRelationship3":cRelationship3
				   };
	
	$.ajax({
        type: "POST",
        url: "/moblie/saveUserContactInfo",
        data:dataParam,
        dataType: "json",
        success: function(data){
                if(data=='200'){
                	new TipBox({type:'success',str:'操作成功',clickDomCancel:true,setTime:1300,hasBtn:false}); 
                	setTimeout(window.location.href='/moblie/bankFrom', 2600);
                }else if(data=='201'){
                	new TipBox({type:'tip',str:'请重新登录',clickDomCancel:true,setTime:1300,hasBtn:false}); 
                	setTimeout(window.location.href='/moblie/login', 2600);
                }else if(data=='202'){
                	new TipBox({type:'error',str:'错误码-10003!',hasBtn:true});  
                }     
          }
    });
	
}

</script>
<script>
    var obUrl = ''
    //document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
    $("#clipArea").photoClip({
        width: 199,
        height: 166,
        file: "#file",
        view: "#view",
        ok: "#clipBtn",
        loadStart: function() {
            console.log("照片读取中");
        },
        loadComplete: function() {
            console.log("照片读取完成");
        },
        clipFinish: function(dataURL) {
            console.log(dataURL);
        }
    });
</script>
<script>
    $(function(){
$("#logox").click(function(){
    $(".htmleaf-container").show();
})
        $("#clipBtn").click(function(){
            $("#logox").empty();
            $('#logox').append('<img src="' + imgsource + '" align="absmiddle" style=" width: 5rem;height: 4.16rem; margin-left: 1.5rem;margin-top: 1.92rem">');
            $(".htmleaf-container").hide();
        })
    });
</script>
<script type="text/javascript">
    $(function(){
        jQuery.divselect = function(divselectid,inputselectid) {
            var inputselect = $(inputselectid);
            $(divselectid+" small").click(function(){
                $("#divselect ul").toggle();
                $(".mask_select").show();
            });
            $(divselectid+" ul li a").click(function(){
                var txt = $(this).text();
                $(divselectid+" small").html(txt);
                var value = $(this).attr("selectid");
                inputselect.val(value);
                $(divselectid+" ul").hide();
                $(".mask_select").hide();
                $("#divselect small").css("color","#333");
                $("#inputselect").val(txt);
            });
        };
        $.divselect("#divselect","#inputselect");
    });
</script>
<script type="text/javascript">
    $(function(){
        jQuery.divselectx = function(divselectxid,inputselectxid) {
            var inputselectx = $(inputselectxid);
            $(divselectxid+" small").click(function(){
                $("#divselectx ul").toggle();
                $(".mask_select").show();
            });
            $(divselectxid+" ul li a").click(function(){
                var txt = $(this).text();
                $(divselectxid+" small").html(txt);
                var value = $(this).attr("selectidx");
                inputselectx.val(value);
                $(divselectxid+" ul").hide();
                $(".mask_select").hide();
                $("#divselectx small").css("color","#333");
                $("#inputselectx").val(txt);
            });
        };
        $.divselectx("#divselectx","#inputselectx");
    });
</script>
<script type="text/javascript">
    $(function(){
        jQuery.divselecty = function(divselectyid,inputselectyid) {
            var inputselecty = $(inputselectyid);
            $(divselectyid+" small").click(function(){
                $("#divselecty ul").toggle();
                $(".mask_select").show();
            });
            $(divselectyid+" ul li a").click(function(){
                var txt = $(this).text();
                $(divselectyid+" small").html(txt);
                var value = $(this).attr("selectyid");
                inputselecty.val(value);
                $(divselectyid+" ul").hide();
                $(".mask_select").hide();
                $("#divselecty small").css("color","#333");
                $("#inputselecty").val(txt);
            });
        };
        $.divselecty("#divselecty","#inputselecty");
    });
</script>
<script type="text/javascript">
    $(function(){
       $(".mask_select").click(function(){
           $(".mask_select").hide();
           $(".all").hide();
       })
        $(".right input").blur(function () {
            if ($.trim($(this).val()) == '') {
                $(this).addClass("place").html();
            }
            else {
                $(this).removeClass("place");
            }
        })
    });
</script>
<script>
    $("#file0").change(function(){
        var objUrl = getObjectURL(this.files[0]) ;
         obUrl = objUrl;
        console.log("objUrl = "+objUrl) ;
        if (objUrl) {
            $("#img0").attr("src", objUrl).show();
        }
        else{
            $("#img0").hide();
        }
    }) ;
   function qd(){
       var objUrl = getObjectURL(this.files[0]) ;
       obUrl = objUrl;
       console.log("objUrl = "+objUrl) ;
       if (objUrl) {
           $("#img0").attr("src", objUrl).show();
       }
       else{
           $("#img0").hide();
       }
   }
    function getObjectURL(file) {
        var url = null ;
        if (window.createObjectURL!=undefined) { // basic
            url = window.createObjectURL(file) ;
        } else if (window.URL!=undefined) { // mozilla(firefox)
            url = window.URL.createObjectURL(file) ;
        } else if (window.webkitURL!=undefined) { // webkit or chrome
            url = window.webkitURL.createObjectURL(file) ;
        }
        return url ;
    }
</script>
<script type="text/javascript">
  var subUrl = "";
    $(function (){
        $(".file-3").bind('change',function(){
            subUrl = $(this).val()
            $(".yulan").show();
            $(".file-3").val("");
        });

        $(".file-3").each(function(){
            if($(this).val()==""){
                $(this).parents(".uploader").find(".filename").val("营业执照");
            }
        });
$(".btn-3").click(function(){
    $("#img-1").attr("src", obUrl);
    $(".yulan").hide();
    $(".file-3").parents(".uploader").find(".filename").val(subUrl);
})
        $(".btn-2").click(function(){
            $(".yulan").hide();
        })

    });
</script>
<script type="text/javascript">
    function setImagePreview() {
        var preview, img_txt, localImag, file_head = document.getElementById("file_head"),
                picture = file_head.value;
        if (!picture.match(/.jpg|.gif|.png|.bmp/i)) return alert("您上传的图片格式不正确，请重新选择！"),
                !1;
        if (preview = document.getElementById("preview"), file_head.files && file_head.files[0]) preview.style.display = "block",
                preview.style.width = "63px",
                preview.style.height = "63px",
                preview.src = window.navigator.userAgent.indexOf("Chrome") >= 1 || window.navigator.userAgent.indexOf("Safari") >= 1 ? window.webkitURL.createObjectURL(file_head.files[0]) : window.URL.createObjectURL(file_head.files[0]);
        else {
            file_head.select(),
                    file_head.blur(),
                    img_txt = document.selection.createRange().text,
                    localImag = document.getElementById("localImag"),
                    localImag.style.width = "63px",
                    localImag.style.height = "63px";
            try {
                localImag.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)",
                        localImag.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = img_txt
            } catch(f) {
                return alert("您上传的图片格式不正确，请重新选择！"),
                        !1
            }
            preview.style.display = "none",
                    document.selection.empty()
        }
        return document.getElementById("DivUp").style.display = "block",
                !0
    }
</script>
</body>
</html>
